package common.Tables;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 * candidate include candidateId ,candidate name , and set of files 
 * (many to many relation with Client FILE)
 * @author Orit and Michal
 */


public class Candidate implements Table, Serializable{

	private static final long serialVersionUID = 1L;
	private String candidateId;
	private String candidateName = "";
	private Set<Client> clients = new HashSet<Client>(0);

	//-----------------setters && getters for candidate----------------//
	/**
	 * set candidate id 
	 * @param candidateId
	 */
	public void setCandidateId(String candidateId) {
		this.candidateId = candidateId;
	}
	/**
	 * set candidate full Name
	 * @param candidateName
	 */
	public void setCandidateName(String candidateName) {
		this.candidateName = candidateName;
	}
	/**
	 * set client Files
	 * @param files
	 */
	public void setClients(Set<Client> clients) {
		this.clients = clients;
	}
	/**
	 * get candidate Id
	 * @return candidate id
	 */
	public String getCandidateId() {
		return candidateId;
	}
	/**
	 * get candidate Name
	 * @return candidate name
	 */
	public String getCandidateName() {
		return candidateName;
	}
	/**
	 * get client Files
	 * @return client's files
	 */
	public Set<Client> getClients() {
		return clients;
	}
	/**
	 * 
	 */
	@Override
	public String toString() {		
		return String.valueOf(candidateId);
	}
	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		Candidate can = (Candidate) obj;
		return can.getCandidateId()==candidateId;
	}

}
